# 导入 OpenCV
import cv2
# print('11')
# 读取图片
# cv2.imread(图片路径,flags)

# img = cv2.imread("Resources/lena.png")
# cv2.imshow("Output", img)
# cv2.waitKey(0)
# cap = cv2.VideoCapture("Resources/test_video.mp4")
# 打开摄像头（0表示第一个摄像头）
cap = cv2.VideoCapture(0)
cap.set(3, 1640)
cap.set(4, 680)
cap.set(10, 100)
if not cap.isOpened():
    print("无法打开摄像头")
    exit()

# 一帧一帧读取
while True:
    success, img = cap.read()
    cv2.imshow("Video ", img)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break